package ch09_io.bio;

import java.io.File;
import java.io.FileOutputStream;
import java.nio.charset.StandardCharsets;

/**
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class AMainTest {
    public static void main(String[] args) throws Exception {
        File file = new File("d:/test/test.txt");
        System.out.println(file.isDirectory());
        System.out.println(file.exists());
        System.out.println(file.createNewFile());
        FileOutputStream out = new FileOutputStream(file);
        byte[] bytes = "中国".getBytes(StandardCharsets.UTF_8);
        out.write(bytes);
        out.close();
    }
}
